#pragma once

#include "Jerry's Physics\Dynamic_Array.h"
#include "ClockEngine.h"
#include "gProjectile.h"

class gWeapon : public gObject
{
private:
	V3DF*    m_attach;
	float    m_distance;
	clkMesh* m_target;

	char* m_projMesh;
	char* m_projTexture;
	int   m_projCount;
	int   m_projAmount;
	float m_projRadius;
	float m_projSpeed;
	float m_projDamage;
	Dynamic_Array<gProjectile*>* m_projList;
public:
	gWeapon();
	~gWeapon();

	void initWeapon(
		V3DF*    a_attach,
		float    a_distance,
		clkMesh* a_target);
	void initProjectile(
		char* a_projMesh,
		char* a_projTexture,
		int   a_projAmount,
		float a_projRadius,
		float a_projSpeed,
		float a_projDamage,
		Dynamic_Array<gProjectile*>* a_projList);
	void release();

	void input();
	void update();

	void createProjectile();
};